package com.home.java;

//（1）public void print(Emplyee[] all)
// 遍历打印员工数组中的每个员工的详细信息
//​(2）public void sort(Employee[] all)：
// 将all员工数组按照年龄从高到低排序
//​（3）public void addSalary(Employee[] all,
//  double increament)：将all员工数组的每一个员工的工资，增加increament
public class EmployeeManager {
    public void print(Employee[] all) {
        for (int i = 0; i < all.length; i++) {
            for (int j = 0; j < all.length - i; j++) {
                if (all[j].age < all[j + 1].age) {
                    Employee temp = all[j];
                    all[j] = all[j + 1];
                    all[j + 1] = temp;
                }
            }
        }
    }
    public void addSalary(Employee[] all, double increament){
          for(int i = 0 ; i<all.length; i++){
              all[i].salary += increament;

          }
    }

}